const categoryDao = require('../dao/categoryDao');
const serviceCommon = require('../util/serviceCommon');

const service = {
    handleAddCategory: async (data) => {
        let result;
        result = await serviceCommon.addDataMethod(categoryDao, 'handleAddCategory', data);
        return result;
    },
    handleEditCategory: async (data) => {
        let result;
        result = await serviceCommon.editDataMethod(categoryDao, 'handleEditCategory', data);
        return result;
    },
    handleDeleteCategory: async (data) => {
        let result;
        result = await serviceCommon.deleteDataMethod(categoryDao, 'handleDeleteCategory', data);
        return result;
    },
    handleGetCategory: async () => {
        let result;
        result = await serviceCommon.getListMethod(categoryDao, 'handleGetCategory');
        return result;
    },
    handleGetImgUrl: async () => {
        let result;
        result = await serviceCommon.getListMethod(categoryDao, 'handleGetImgUrl');
        return result;
    }
};
module.exports = service;